home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NT Sources
/
Infomagic - NT Source Volume 1 (Disc 1 of 2).iso
/
network
/
pcdctrla.exe
/
PCDCTRL.EXE
/
PCDTPL.TPU
< prev
next >
Wrap
Text File
|
1997-09-08
|
1KB
|
44 lines
!+++
! PCDUO_TEMPLATE.TPU - Edits a PATHWORKS 5 template file for PC-Duo
!---
! We have to edit 1 section - [User Commands]. We add a call to STARTSLV.BAT.
! If it already present, the existing line will be replaced by the new one.
PROCEDURE LUT_update_template ();
! Declare some local variables - initialised to zero
LOCAL LUT_user_range; ! Limit the replacement to a range
LUT_user_range := LUT_create_range (LINE_BEGIN + "[User Commands]", LINE_BEGIN + "[");
! See whether the section exists. If not, create a new one
If LUT_user_range = 0
Then
MESSAGE (FAO ("Creating new [User Commands] section"));
LUT_line_insert_bottom (""); ! Add a blank line
LUT_line_insert_bottom ("[User Commands]");
LUT_line_insert_bottom (
" if exist \pcduo\startslv.bat call \pcduo\startslv.bat");
LUT_line_insert_bottom (""); ! Add a blank line
Else
LUT_line_replace_add ("startslv.bat",
" if exist \pcduo\startslv.bat call \pcduo\startslv.bat", LUT_user_range);
Endif;
ENDPROCEDURE;
LUT_start_edit (); ! This reads the file (if it exists), creates a buffer,
! and positions us at the top of the buffer
IF LUT_buffer_empty
THEN
quit; ! Error - the input file must exist!
ENDIF;
LUT_update_template ();
! And now perform 'standard' finishing functions...
LUT_finish_edit ();